/**
 * 
 */
package exteditapp.action;

import exteditapp.AppStarter;
import exteditapp.IModuleApplet;
import exteditapp.state.StateUnlocking;

/**
 * @author arturas
 *
 */
public class ActionWaiting extends IAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6606305982192919550L;

	/**
	 * This constructor is used from States - then we are describing state's action list
	 */
	public ActionWaiting(){
		//set menu elements
		this.actionList = new IAction[] {
			this.setTextGetAction("WAITING FOR ANY CHANGES...#PRESS TO OPEN APPLICATION (NEW WINDOW)"),
			new ActionEditing(true, "Turn autosave off"),
			new ActionUnlocking(true, "End editing (without save)"),
		};
	}
	
	/**
	 * This constructor is used in menu construction - initializes action;
	 * @see exteditapp.action.IAction#init(IModuleApplet, boolean)
	 */
	public ActionWaiting(boolean isEnabled){
		this.init(isEnabled);
	}
	
	/**
	 * This constructor is used in menu construction - initializes action;
	 * @see exteditapp.action.IAction#init(IModuleApplet, boolean, String)
	 */
	public ActionWaiting(boolean isEnabled, String newLabel){
		this.init(isEnabled, newLabel);
	}
	
	/**
	 * @see exteditapp.action.IAction#execute()
	 */
	public void execute() {
		AppStarter l = new AppStarter(this.main.getWorkingFile().getFileAsObject().getPath());
		l.launch();
	}

}
